package com.hujh.android.ui.tabhost;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

import com.hujh.android.R;

//不继承TabActivity
public class TabHostActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.activity_host);
		
		TabHost tabHost = (TabHost)this.findViewById(R.id.tabs);
		tabHost.setup();
		
		TabSpec tabSpec1 = tabHost.newTabSpec("tab1");
		tabSpec1.setIndicator("文件1", this.getResources().getDrawable(R.drawable.folder));
		tabSpec1.setContent(R.id.txtV1);
		
		TabSpec tabSpec2 = tabHost.newTabSpec("tab2");
		tabSpec2.setIndicator("文件2", this.getResources().getDrawable(R.drawable.download));
		tabSpec2.setContent(R.id.txtV2);
		
		tabHost.addTab(tabSpec1);
		tabHost.addTab(tabSpec2);
		
		
		
		
	}

}
